use strict; 

$myhostname = 'lists.debian.org';  # fqdn of this host, default by uname(3)
$myhostname = $1 if $myhostname =~ /^(.+)$/;

#enable virus checking 
@bypass_virus_checks_maps = (
   \%bypass_virus_checks, \@bypass_virus_checks_acl,
   \$bypass_virus_checks_re);

#enable spam checking 
@bypass_spam_checks_maps = (
   \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);


$max_servers  =  8;   # number of pre-forked children          (default 2)
$max_requests = 100;   # retire a child after that many accepts (default 10)

$child_timeout=5*60;  # abort child if it does not complete each task in n sec
                      # (default: 8*60 seconds)


# we listen on ports 2525 for postfix and on 61000 for our developmentpb 
$inet_socket_port = [ 2525, 61000 ];

#networks considered local (maybe used later for %l or MYNETS policybank)
@mynetworks = qw (      127.0.0/8 ::1 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );

#raise the loglevel to 2 to get more informations in mail.log
$log_level = 2; 

#use the verbose logtemplate
$log_templ = $log_verbose_templ;

#our basic spam/virus setting
$final_virus_destiny      = D_DISCARD;  # (defaults to D_DISCARD)
$final_banned_destiny     = D_DISCARD;  # (defaults to D_BOUNCE)
$final_spam_destiny       = D_DISCARD;  # (defaults to D_BOUNCE)
$final_bad_header_destiny = D_PASS;  # (defaults to D_PASS), D_BOUNCE suggested

#please don't do any notfications

$warnbadhsender = undef;
$warnvirusrecip = undef; 
$warnbannedrecip = undef; 
$warnbadhrecip = undef; 
$warn_offsite = undef; 

$virus_admin = undef; 
$spam_admin = undef;
$bad_header_admin = undef; 
$banned_admin = undef; 

$undecipherable_subject_tag = undef; 
#just to be sure....
$spam_admin = undef;    # do not send spam admin notifications (default)

#defang virus and banned files. 
$defang_virus  = 1;  # default is false: don't modify mail body
$defang_banned = 1;  # default is false: don't modify mail body


# Maximum recursion level for extraction/decoding (0 or undef disables limit)
$MAXLEVELS = 14;                # (default is undef, no limit)

# Maximum number of extracted files (0 or undef disables the limit)
$MAXFILES = 5000;               # (default is undef, no limit)


# For the cumulative total of all decoded mail parts we set max storage size
# to defend against mail bombs. Even though parts may be deleted (replaced
# by decoded text) during decoding, the size they occupied is _not_ returned
# to the quota pool.
#
# Parameters to storage quota formula for unpacking/decoding/decompressing
#   Formula:
#     quota = max($MIN_EXPANSION_QUOTA,
#                 $mail_size*$MIN_EXPANSION_FACTOR,
#                 min($MAX_EXPANSION_QUOTA, $mail_size*$MAX_EXPANSION_FACTOR))
#   In plain words (later condition overrules previous ones):
#     allow MAX_EXPANSION_FACTOR times initial mail size,
#     but not more than MAX_EXPANSION_QUOTA,
#     but not less than MIN_EXPANSION_FACTOR times initial mail size,
#     but never less than MIN_EXPANSION_QUOTA
#
$MIN_EXPANSION_QUOTA =      100*1024;  # bytes  (default undef, not enforced)
$MAX_EXPANSION_QUOTA = 300*1024*1024;  # bytes  (default undef, not enforced)
$MIN_EXPANSION_FACTOR =   5;  # times original mail size  (must be specified)
$MAX_EXPANSION_FACTOR = 500;  # times original mail size  (must be specified)

##
## Spamassassin Settings
##

$sa_mail_body_size_limit = 64*1024; # don't waste time on SA if mail is larger
                            # (less than 1% of spam is > 64k)
                            # default: undef, no limitations

#should be configured via policybank - just to be sure. 
$sa_kill_level_deflt = 100000; # triggers spam evasive actions

$sa_tag_level_deflt = -10000; 

$interface_policy{'61000'} = 'pb_playground';

# load our policybanks

$policy_bank{'ALT'} = { log_level => 3 };
sub do_or_die {
        my $f = shift;
        my $bank = $f;
        $bank =~ s/^.*pb_(.*)\.conf/$1/;
        open (my $c, $f) or die "Can't read $f";
        my $code = join ('', <$c>);
        $code =~ /^(.*)$/sm;
        $code = $1;
        eval $code or die "Can't evaluate $f";
        close $c;
}
do_or_die ($_) foreach (glob("/var/list/.etc/dot-amavis/policybanks/pb_*.conf"));

1; #insure a defined return

